
class Individual:
    '''
    An indivudual
    @chrom: chromosome of individual
    @size: size of individual
    @height: heigh of individual
    @branch: branching of individual
    @fitness: fitness of individual
    '''
    def __init__(self, chrom=None, size=0, height=0, branch=0, fitness=0):
        self.chrom = chrom
        self.size = size
        self.height = height
        self.branch = branch
        self.fitness = fitness

    #def __del__(self):
        #del self.chrom

    def Copy(self, copychrom):
        '''
        Copy an individual
        '''
        v = Individual()
        if(copychrom):
            v.chrom = self.chrom.Copy()
        else:
            v.chrom = self.chrom
        v.size = self.size
        v.height = self.height
        v.fitness = self.fitness
        v.branch = self.branch
        return v

    def Display(self):
        print '------------------------------------------'
        print 'Genotype structure:'
        print self.chrom.ToString()
##        self.chrom.Draw()
        print 'Size: ', self.size
        print 'Height: ', self.height
        print 'Branching: ', self.branch
        print 'Fitness: ', self.fitness
